package com.继承.基础;
class People{
    String name;
    static int age = 12;
    String sex;
    
    void action(){
        System.out.println(this.name+"需要吃饭");
    }
}
class Boy extends People{

    void fun1(){
        System.out.println(this.name+"力气大");
    }

    @Override
    public String toString() {
        return "name='" + name + '\'' +", age="+age+
                ", sex='" + sex + '\'' ;
    }
}
class Gril extends People{
    void fun1(){
        System.out.println(this.name+"力气小");
    }
}
public class extends_1 {
    public static void main(String[] args) {
        Boy boy =new Boy();
        boy.name ="小明";
        boy.fun1();
        System.out.println(Boy.age);//访问父类的静态变量
        System.out.println(boy.toString());

        Gril gril = new Gril();
        gril.name = "小红";
        gril.fun1();
    }
}
